﻿using HalconDotNet;
using LD.Host;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LD.Vision
{
    public class TemplateModel
    {
        public string Name { get; set; }
        /// <summary>
        /// 模板roi 
        /// </summary>
        public List<ViewWindow.Model.ROI> Roi { get; set; } = new List<ViewWindow.Model.ROI>();
        public string RoiXmlPath { get; set; }
        public string RoiTmpXmlPath { get; set; }
        /// <summary>
        /// 感兴趣区域
        /// </summary>
        public List<ViewWindow.Model.ROI> RoiTmp { get; set; } = new List<ViewWindow.Model.ROI>();
        public TemplateParamModel Param { get; set; }=new TemplateParamModel();
        public HShapeModel hShapeModel { get; set; }=new HShapeModel();
        public void Save(string filePath)
        {
            JsonSerializeHelper.Save(this, filePath);
        }
        public void Load(string filePath)
        {
            var _this = JsonSerializeHelper.Load<TemplateModel>(filePath);
            Param = _this.Param;
            Name = _this.Name;
            Roi = _this.Roi;
            RoiTmp = _this.RoiTmp;
        }
    }
}
